﻿using System;
using System.Windows.Data;
using System.Windows.Media;

namespace BezierApproximations
{
    public class SweepDirectionToBooleanConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            SweepDirection sweepDirection = (SweepDirection)value;

            return sweepDirection == SweepDirection.Clockwise;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            bool? isClockwise = (bool?)value;

            return isClockwise == true ? SweepDirection.Clockwise : SweepDirection.Counterclockwise;
        }
    }
}
